package com.example.administrator.schoolblog;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class InitActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }
    private void initView() {
        SharedPreferences LoginPref =getSharedPreferences("logindata",MODE_PRIVATE);
        boolean islogin = LoginPref.getBoolean("islogin",false);
        Intent intent;
        if (islogin==false){
            intent=new Intent(InitActivity.this,LoginActivity.class);
        }else{
            intent = new Intent(InitActivity.this,MainActivity.class);
        }
        startActivity(intent);
        finish();
    }
}
